package com.qfedu.dao;

import com.qfedu.entity.TQuestion;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface QuestionDao {

    /**
     *  资源库
     * @return
     */
    @Select("select * from t_question")
    List<TQuestion> getAllQuestion();

    /**
     * 修改资源库数据
     * @param tQuestion
     * @return
     */
    @Update("update t_question set question = #{question} , answer = #{answer} , qtype = #{qtype} , flag = #{flag} where id = #{id}")
    int updateQuestion(TQuestion tQuestion);

    /**
     * 删除资源库数据
     * @param id
     * @return
     */
    @Delete("delete from t_question where id = #{id}")
    int deleteQuestion(int id);
}
